<template>
  <view class="page_content">
    <view class="type_item" v-for="item in typeList" :key="item.id">
      <view class="top_line">
        <view class="top_left">类别名称：{{item.name}}</view>
        <view class="top_right" @tap='deleteItem(item.id)'>删除</view>
      </view>
      <view class="bottom_line">创建时间：{{item.create_time}}</view>
    </view>
    <AtFab :onClick="onButtonClick" class="at_fab_position" size="normal">
      <text class='at-fab__icon at-icon at-icon-add'></text>
    </AtFab>
  </view>
</template>
<script>
import businessAPI from '../../../api/business.js'
import './oilType.module.scss'
import Taro from '@tarojs/taro'
export default {
  name: 'user',
  data(){
    return{
      typeList: [], // 油品分类列表
    }
  },
  mounted(){
    this.getData();
  },
  methods: {
    async getData(){
      var data = {
        app_id: Taro.getStorageSync('app_id')
      }
      const res = await businessAPI.getOilType(data);
      if(res.code == 200){
        this.typeList = res.data
      }
    },
    onButtonClick(){
      console.log('bt_click')
    }
  }
}

</script>
